Telegram Group & Telegram Channel
Common techniques for using the set() function in Python:

1. Create a set from a list:

my_list = [1, 2, 2, 3, 3, 3]
my_set = set(my_list)


2.Add an item to a set:

my_set = {1, 2, 3}
my_set.add(4)


3.Remove an item from a set by its value:

my_set = {1, 2, 3}
my_set.remove(3)


4.Check if an item is in a set:

my_set = {1, 2, 3}
if 3 in my_set:
print("The item is in the set.")


5.Get the length of a set:

my_set = {1, 2, 3}
set_length = len(my_set)


6.Loop through the items in a set:

my_set = {1, 2, 3}
for item in my_set:
print(item)


7.Get the union of two sets:

set1 = {1, 2, 3}
set2 = {3, 4, 5}
union_set = set1.union(set2)


8.Get the intersection of two sets:

set1 = {1, 2, 3}
set2 = {3, 4, 5}
intersection_set = set1.intersection(set2)

Share and Support
@Python_Codes



tg-me.com/python_codes/252
Create:
Last Update:

Common techniques for using the set() function in Python:

1. Create a set from a list:

my_list = [1, 2, 2, 3, 3, 3]
my_set = set(my_list)


2.Add an item to a set:

my_set = {1, 2, 3}
my_set.add(4)


3.Remove an item from a set by its value:

my_set = {1, 2, 3}
my_set.remove(3)


4.Check if an item is in a set:

my_set = {1, 2, 3}
if 3 in my_set:
print("The item is in the set.")


5.Get the length of a set:

my_set = {1, 2, 3}
set_length = len(my_set)


6.Loop through the items in a set:

my_set = {1, 2, 3}
for item in my_set:
print(item)


7.Get the union of two sets:

set1 = {1, 2, 3}
set2 = {3, 4, 5}
union_set = set1.union(set2)


8.Get the intersection of two sets:

set1 = {1, 2, 3}
set2 = {3, 4, 5}
intersection_set = set1.intersection(set2)

Share and Support
@Python_Codes

BY Python Codes


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python_codes/252

View MORE
Open in Telegram


Python Codes Telegram | DID YOU KNOW?

Date: |

Export WhatsApp stickers to Telegram on iPhone

You can’t. What you can do, though, is use WhatsApp’s and Telegram’s web platforms to transfer stickers. It’s easy, but might take a while.Open WhatsApp in your browser, find a sticker you like in a chat, and right-click on it to save it as an image. The file won’t be a picture, though—it’s a webpage and will have a .webp extension. Don’t be scared, this is the way. Repeat this step to save as many stickers as you want.Then, open Telegram in your browser and go into your Saved messages chat. Just as you’d share a file with a friend, click the Share file button on the bottom left of the chat window (it looks like a dog-eared paper), and select the .webp files you downloaded. Click Open and you’ll see your stickers in your Saved messages chat. This is now your sticker depository. To use them, forward them as you would a message from one chat to the other: by clicking or long-pressing on the sticker, and then choosing Forward.

Telegram has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.Python Codes from tr


Telegram Python Codes
FROM USA